<?php
/* @var $this CourseController */
/* @var $id id*/
/* @var $model trainer*/

$this->main_menu = MenuHelper::getArrayForMainMenu(false, true, false);
?>

<?php
$this->widget('bootstrap.widgets.TbTabs', array(
	'type'=>'tabs', // 'tabs' or 'pills'
	'tabs'=>array(
		array('label'=>'Übersicht', 'url'=>$this->createUrl('course/admin'), 'active'=>false),
                array('label'=>'NEU', 'url'=>$this->createUrl('course/create'), 'active'=>false),
		array('label'=>'NEU aus Vorlage', 'url'=>$this->createUrl('course/chooseTemplate'), 'active'=>false),
//                array('label'=>'|', 'itemOptions'=>array('class'=>'disabled'), 'url'=>$this->createUrl('course/addTrainerToCourse', array('trainer_id'=>null, 'course_id'=>$id))),
                array('label'=>'Stammdaten', 'url'=>$this->createUrl('course/update', array('id'=>$id)), 'active'=>false),
                array('label'=>'Trainer', 'url'=>$this->createUrl('course/trainer', array('id'=>$id)), 'active'=>true),
                array('label'=>'Teilnehmer', 'url'=>$this->createUrl('course/user', array('id'=>$id)), 'active'=>false),
//                array('label'=>'|', 'itemOptions'=>array('class'=>'disabled'), 'url'=>$this->createUrl('course/addTrainerToCourse', array('trainer_id'=>null, 'course_id'=>$id))),

	),
));
?>

<?php
    $this->widget('bootstrap.widgets.TbExtendedGridView', array(
    'filter'=>$model,
    'fixedHeader' => false,
    'headerOffset' => 40, // 40px is the height of the main navigation at bootstrap
    'type'=>'striped bordered',
    'dataProvider' => $model->search(),//$model->search(),
    'template' => '{items}{pager}', // 2nd way
//    'template' => "{items}",
	'columns'=>array(
		'last_name',
		'first_name',
                'email',
                'mobile',
            array (
                'class'=>'CButtonColumn',
                'template'=>'{hinzufügen}',
                'buttons' => array(
                  'hinzufügen' => array(
                    'url'=>'Yii::app()->createUrl("course/addTrainerToCourse", array("trainer_id"=>$data->trainer_id, "course_id"=>' . $id . '))',  
                  ),
                ),
            ),
	),
    ));
?>

